﻿using System;
using UnityEngine;

public class BillboardRotation : MonoBehaviour
{
    private Transform camTsm;
    private Transform tsm;

    private void Awake()
    {
        this.tsm = base.transform;
    }

    private void LateUpdate()
    {
        if (this.camTsm == null)
        {
            Camera main = Camera.main;
            this.camTsm = (main == null) ? null : main.transform;
        }
        if (this.camTsm != null)
        {
            this.tsm.rotation = this.camTsm.rotation;
        }
    }
}

